<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><neq name= '_title' value=''>{$_title} - {$site.site_name}<else />{$site.site_name} - {$site.site_slogan}</neq></title>
<meta content="<neq name= '_keywords' value=''>{$_keywords}<else />{$site.site_header_keywords}</neq>" name="keywords">
<meta content="<neq name= '_description' value=''>{$_description}<else />{$site.site_header_description}</neq>" name="description">
<meta name="viewport" charset="UTF-8" content="user-scalable=no"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<script src="__THEME__/js/jquery.js?v={$site.sys_version}"></script>
<link href="__THEME__/css/basic.css" rel="stylesheet" type="text/css">
<link href="__THEME__/css/common.css" rel="stylesheet" type="text/css">
<link href="__THEME__/css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="header">
    <div class="header_top">
        <div class="wrap">
            <div class="header_user"><img src="{:getUserFace($_SESSION['mid'])}">你好！{:getUserName($_SESSION['mid'])}
            <if condition="$userGroup eq 2 OR $userGroup eq 3">的领导</if>
            <if condition="$userGroup eq 4">的园长</if>
            <if condition="$userGroup eq 5">的老师</if>
            <span class="line">|&nbsp;&nbsp;<a href="javascript:savepwd({$_SESSION['mid']});">修改密码</a>&nbsp;&nbsp;|</span><a href="{:U('public/Passport/logout')}">退出</a></div>
            <div class="header_logo">
            <if condition="$userGroup eq 1">健康平台</if>
            <if condition="$userGroup eq 2">市级健康平台</if>
            <if condition="$userGroup eq 3">区级健康平台</if>
            <if condition="$userGroup eq 4">园级健康平台</if>
            <if condition="$userGroup eq 5">班级健康平台</if>
            </div>
        </div>
    </div>
    <div class="header_bot">
        <div class="wrap">
            <ul class="header_nav">
              <li <php>if(MODULE_NAME == 'Report'){</php> class="on" <php>}</php>><a href="{:U('public/Report/Area')}"><span class="icon-pjbg"></span>健康报告</a></li>
              <li <php>if(MODULE_NAME == 'Resources'){</php> class="on" <php>}</php>><a href="{:U('public/Resources/index')}"><span class="icon-xxzy"></span>学习资源</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="pop_wrap" id="update_pwd" style="display:none;position:absolute;z-index:999;">
  <div class="pop_box">
      <div class="pop_head"><a class="close" href="javascript:close();">X</a>用户密码修改</div>
        <div class="pop_body">
          <dl class="diapei_dl">
            <dl class="diapei_dl">
              <dt>新密码：</dt>
                <dd>
                    <input type="text" id="new_pwd">
                </dd>
            </dl>
        </div>
        <ul class="pop_foot">
            <input type="hidden" id="uid">
          <li><a href="javascript:close();">取消</a></li>
          <li><a href="javascript:doUpdateUserpwd();">确定</a></li>
        </ul>
    </div>
</div>
<script>
    function savepwd(id){
        $("#uid").val(id);
        $("#update_pwd").css("display","block");
    }
    function doUpdateUserpwd(){
       var uid=$("#uid").val();
       var pwd=$("#new_pwd").val();
       if(pwd==""){
        alert("请输入密码");
        return;
       }
       $.ajax({
          type: "POST",
          url:"{:U('admin/Privilege/doUpdateUserPwd')}",
          data:"uid="+uid+"&pwd="+pwd,
          dataType:"text",
          success:function(data){
            if(isNaN(data)){
              alert(data);
            }else{  
                close();
                alert("修改成功，请重新登录！");
                window.location.href="{:U('public/Passport/logout')}";
            }
          }
        });
    }
    function close(){
        $("#uid").val("");
        $("#new_pwd").val("");
        $("#update_pwd").css("display","none");
    }
</script>
<div class="content">
  <div class="wrap">
      <div class="con_side">
        <ul class="nav">
          <li  class="cursor"><a href="{:U('public/Report/Area')}">市区级报告</a></li>
        </ul>
      </div>
        <div class="con_main">
          <div class="con_tit">
            <span>筛选条件</span>
            <ul class="con_tit_ul">
              <li>
                <a href="javascript:;" onclick="selectChildren(this);" id="file_type">测试年份</a>
                <ul class="children">
                  <volist name="year" id="year">
                  <li><a href="javascript:;"onclick="selectYear(this,{$year});">{$year}</a></li>
                </volist>
                </ul>
              </li>
              <li>
                <a href="javascript:;" onclick="selectChildren(this);" id="resource_type">测试季度</a>
                <ul class="children" id="numberList">
                  <li><a href="javascript:;" onclick="selectNumber(this,1);">春季</a></li>
                  <li><a href="javascript:;" onclick="selectNumber(this,2);">秋季</a></li>
                </ul>
              </li>
              <li>
              <input type="hidden" id="number">
              <input type="hidden" id="year">
              <div href="javascript:;" onclick="select_filter();" style="background:#f68d04;margin-left:15px;width:70px;text-align:center; color:#efefef;line-height: 45px;cursor:pointer;">确定</div></li>
            </ul>
            </div>
            <div class="con_tit">
              <table class="table table_title t4">
                <tr>
                  <td>报告名称</td>
                  <td>操作</td>
                </tr>
              </table>
            </div>
            <div class="con_box" id="area_list"></div>
        </div>
    </div>
</div>
<script>
$("#year").val("");
$("#number").val("");
  $.ajax({
    type: "GET",
    url:"{:U('public/Report/getAreaList')}",
    data:"p=1",
    dataType:"json",
    success:function(data){
        appendHtml(data);
    }
  });
function appendHtml(data){
    $("#area_list").html("");
    $("#area_list").append(data.data);
    var html="<div class='pagebox'>";
    if(data.nowPage>1 ){
        page=data.nowPage-1;
        html+="<a href=\"javascript:getList("+page+")\">上一页</a>";
    }
    for (var i = 1; i <=data.totalPages; i++) {
        if(i==data.nowPage){
            html+="<a href=\"javascript:getList("+i+")\" class='on'>"+i+"</a>";
        }else{
            html+="<a href=\"javascript:getList("+i+")\" >"+i+"</a>";  
        }
    };
    if(data.totalPages>1 && data.nowPage<data.totalPages){
        page=data.nowPage+1;
        html+="<a href=\"javascript:getList("+page+")\" id=\"getList\">下一页</a>";
    }
    html+="</div>";
    $("#area_list").append(html); 
}

//查看更多
function getList(page){
    p=page;
    ajaxBang();
}
//筛选条件
function select_filter(){
  $(".children").css('display','none');
  var number=$("#number").val();
  var year=$("#year").val();
  p=1;
  if(year==""){
    alert("请选择测试年份");
    return;
  }
  if(number==""){
    alert("请选择测试次数");
    return;
  }
  $.ajax({
    type: "GET",
    url:"{:U('public/Report/getAreaList')}",
    data:"p=1&number="+number+"&year="+year,
    dataType:"json",
    success:function(data){
        appendHtml(data);
    }
  });
}
//请求事件
function ajaxBang(){
  $.ajax({
    type: "GET",
    url:"{:U('public/Report/getAreaList')}",
    data:"p="+p+"&number="+number+"&year="+year,
    dataType:"json",
    success:function(data){
        appendHtml(data);
    }
  });
}
function selectChildren(cate){
  $(".children").css('display','none');
  $(cate).next().css('display', 'block');
}
function selectYear(cate,year){
  $(cate).parent().nextAll().children().css('background','');
  $(cate).parent().prevAll().children().css('background','');
  $(cate).css('background','#f3a33a');
  $("#year").val(year);
}
function selectNumber(cate,number){
  $(cate).parent().nextAll().children().css('background','');
  $(cate).parent().prevAll().children().css('background','');
  $(cate).css('background','#f3a33a');
  $("#number").val(number);
}
</script>
<include file="../Public/_foot" />